<?php include "header.html"; ?>

<div id="main">

<?php if($ts == 'list'){ ?>
<h3>用户管理</h3>
<table cellpadding="0" cellspacing="0">
<tr><td>ID</td><td>用户名</td><td>注册时间</td><td>设置</td><td>管理</td></tr>
<?php foreach($users as $key=>$user){ ?>
<tr  class='odd'>
<td><?php echo $user['id']; ?></td><td><?php echo $user['username']; ?></td><td><?php echo date('Y-m-d H:i:s',$user['cTime']) ?></td><td><?php if($user['gag'] == 0){echo "正常";}elseif($user['gag'] == 1){echo "禁言";} ?></td>
<td class='action'><a href="../user.php?id=<?php echo $user['id']; ?>"  target="_blank" class='view'>查看</a><a href="index.php?action=user&ts=edit&id=<?php echo $user['id']; ?>" class='edit'>编辑</a><a href="index.php?action=user&ts=del&id=<?php echo $user['id']; ?>">删除</a></td>
</tr>
<?php } ?>
</table>
<div class="manu">
<?php echo $page_url; ?>
</div>
<?php } ?>

<?php if($ts == 'edit'){ ?>
<h3>编辑用户</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=user&ts=update&id=<?php echo $_GET['id']; ?>">
<p><label>用户名：</label><input type="text" class="text-long" name="username" value="<?php echo $userDate['username']; ?>" /></p>
<p><label>真实姓名：</label><input type="text" class="text-long" name="truename"  value="<?php echo $userDate['truename']; ?>" /></p>
<p><label>Email：</label><input type="text" class="text-long" name="email"  value="<?php echo $userDate['email']; ?>" /></p>
<p><label>用户组：</label><select name="isadmin"><option value="0">普通用户</option><option value="1">系统管理员</option></select></p>
<p><label>受否禁言：</label><select name="gag"><option value="0">正常</option><option value="1">禁言</option></select></p>
<input type="submit" value="更新用户" name="" />
</form>
</fieldset>
<?php } ?>

</div>

<?php include "footer.html"; ?>